home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / SUBS2.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-17  |  52KB  |  1,959 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,N-,L+ }
  2.  
  3. unit subs2;
  4.  
  5. { $define testingdevices}   (* Activate this define for test mode *)
  6.  
  7. interface
  8.  
  9. uses printer,dos,crt,gentypes,configrt,gensubs,subs1,windows,modem,statret,chatstuf,
  10.      flags,mailret,menus;
  11.  
  12. procedure percent_whoa(r1,r2:real;x,y:integer);
  13. procedure beepbeep;
  14. procedure summonbeep;
  15. procedure openttfile;
  16. procedure writecon (k:char);
  17. procedure toggleavail;
  18. function charready:boolean;
  19. procedure UNCRUNCH (var Addr1,Addr2; BlkLen:Integer);
  20. function readchar:char;
  21. function waitforchar:char;
  22. procedure clearchain;
  23. function charpressed (k:char):boolean;  { TRUE if K is in typeahead }
  24. procedure addtochain (l:lstr);
  25. procedure directoutchar (k:char);
  26. procedure handleincoming;
  27. procedure writechar (k:char);
  28. {$F+}
  29.       function opendevice (var t:textrec):integer;
  30.       function closedevice (var t:textrec):integer;
  31.       function cleardevice (var t:textrec):integer;
  32.       function ignorecommand (var t:textrec):integer;
  33.       function directoutchars (var t:textrec):integer;
  34.       function writechars (var t:textrec):integer;
  35.       function directinchars (var t:textrec):integer;
  36.       function readcharfunc (var t:textrec):integer;
  37. {$F+}
  38. function getinputchar:char;
  39. procedure getstr;
  40. procedure writestr (s:anystr);
  41. procedure cls;
  42. Procedure Goxy(x,y:integer);
  43. Procedure AsciiGoxy(x,y:integer);
  44. Procedure ColorFb(ForeGround,Background:Byte);
  45. procedure writehdr (q:anystr);
  46. function issysop:boolean;
  47. procedure reqlevel (l:integer);
  48. procedure printfile (fn:lstr);
  49. procedure printtexttopoint (var tf:text);
  50. procedure skiptopoint (var tf:text);
  51. function minstr (blocks:integer):sstr;
  52. procedure parserange (numents:integer; var f,l:integer);
  53. Procedure User_Prompt;
  54. Procedure GetyaHeader;
  55. Procedure Getyaprompt;
  56. Procedure Eat_Shit;
  57. function menu (mname:mstr; mfn:sstr; choices:anystr):integer;
  58. function getloginpassword (var u:userrec):boolean;
  59. function checkpassword (var u:userrec):boolean;
  60. function getpassword:boolean;
  61. function getsysoppwd:boolean;
  62. procedure getacflag (var ac:accesstype; var tex:mstr);
  63.  
  64. { procedure drawbox (x1,y1,x2,y2:byte;fill:boolean);
  65. function pulldown (itemlist:menutype;
  66.                    win:byte;              Pull Down Window Routines
  67.                    sel:byte;
  68.                    x1,y1,x2,y2:byte;
  69.                    startitem:byte):integer;
  70. function lrmenu (menu:lrmenutype;topc,barc:byte):integer; }
  71. procedure updatenodestatus(Ls:Lstr);
  72.  
  73. implementation
  74.  
  75.  
  76.  
  77. procedure beepbeep;
  78. begin
  79.   nosound;
  80.   sound (200);
  81.   delay (10);
  82.   sendchar(#7);
  83.   nosound
  84. end;
  85.  
  86. procedure summonbeep;
  87. var cnt:integer;
  88. begin
  89.   nosound;
  90.   cnt:=1330;
  91.   repeat
  92.     sound (cnt);
  93.     delay (10);
  94.     cnt:=cnt+200;
  95.   until cnt>4300;
  96.   nosound
  97. end;
  98.  
  99. procedure clearchain;
  100. begin
  101.   chainstr[0]:=#0
  102. end;
  103.  
  104.   Procedure abortttfile(er:Integer);
  105.     Var n:Integer;
  106.     Begin
  107.       specialmsg('[Texttrap Error]: '+strr(er)+'!');
  108.       texttrap:=False;
  109.       textclose(ttfile);
  110.       n:=IOResult
  111.     End;
  112.  
  113.   Procedure openttfile;
  114.     Var n:Integer;
  115.     Begin
  116.       appendfile('TextTrap',ttfile);
  117.       n:=IOResult;
  118.       If n=0
  119.       Then texttrap:=True
  120.       Else abortttfile(n)
  121.     End;
  122.  
  123.       Procedure toggletexttrap;
  124.       Var n:Integer;
  125.       Begin
  126.         If texttrap
  127.         Then
  128.           Begin
  129.             textclose(ttfile);
  130.             n:=IOResult;
  131.             If n<>0 Then abortttfile(n);
  132.             texttrap:=False
  133.           End
  134.         Else openttfile
  135.       End;
  136.  
  137. procedure writecon (k:char);
  138. var r:registers;
  139. begin
  140.    if k=^J
  141.     then write (usr,k)
  142.     else
  143.       begin
  144.         r.dl:=ord(k);
  145.         r.ah:=2;
  146.         intr($21,r)
  147.       end
  148. end;
  149.  
  150. procedure toggleavail;
  151. begin
  152.   if sysopavail=notavailable
  153.     then sysopavail:=available
  154.     else sysopavail:=succ(sysopavail)
  155. end;
  156.  
  157. procedure UNCRUNCH (var Addr1,Addr2; BlkLen:Integer);
  158. begin
  159.   inline ($1E/$C5/$B6/Addr1/$C4/$BE/Addr2/$8B/$8E/BlkLen/$8B/$D7/
  160.           $B4/$00/$AC/$3C/$10/$73/$07/$80/$E4/$F0/$0A/$E0/$EB/$44/
  161.       $3C/$18/$74/$13/$73/$19/$2C/$10/$02/$C0/$02/$C0/$02/$C0/
  162.       $02/$C0/$80/$E4/$0F/$0A/$E0/$EB/$2D/$81/$C2/$A0/$00/$8B/
  163.       $FA/$EB/$25/$3C/$1A/$75/$0B/$AC/$49/$51/$32/$ED/$8A/$C8/
  164.       $AC/$EB/$0D/$90/$3C/$19/$75/$11/$AC/$51/$32/$ED/$8A/$C8/
  165.       $B0/$20/$0B/$C9/$74/$03/$AB/$E2/$FD/$59/$49/$AB/$0B/$C9/
  166.       $74/$02/$E2/$AA/$1F);
  167. end;
  168.  
  169. function charready:boolean;
  170. var k:char;
  171. begin
  172.     if modeminlock then while numchars > 0 do k:= getchar;
  173.   if hungupon or keyhit
  174.     then charready:=true
  175.     else if online
  176.     then charready:=(not modeminlock) and (numchars > 0)
  177.       else charready:=false
  178. end;
  179.  
  180. function readchar:char;
  181.  
  182.   procedure toggletempsysop;
  183.   begin
  184.     if tempsysop
  185.       then ulvl:=regularlevel
  186.       else
  187.         begin
  188.           regularlevel:=ulvl;
  189.           ulvl:=configset.sysopleve
  190.         end;
  191.     tempsysop:=not tempsysop
  192.   end;
  193.  
  194.   Procedure togglebar;
  195.   Begin
  196.     If UseBottom then Begin
  197.     UseBottom:=False;
  198.     initwinds;
  199.     Gotoxy(1,24);
  200.     write(#27,'[K');
  201.     gotoxy(1,25);
  202.     write(#27,'[K');
  203.     UseBottom:=False
  204.     End
  205.     Else Begin
  206.     UseBottom:=True;
  207.     ClrScr;
  208.     initwinds;
  209.     bottomline;
  210.     End;
  211.   End;
  212.  
  213.   procedure togviewstats;
  214.   begin
  215.     if splitmode
  216.       then unsplit
  217.       else
  218.         begin
  219.                     splitscreen (10);
  220.                     top;
  221.                     clrscr;
  222.                     write (usr,'File Level:     ',urec.udlevel,
  223.                                  ^M^J'File Points:    ',urec.udpoints,
  224.                                  ^M^J'XMODEM uploads: ',urec.uploads,
  225.                                  ^M^J'XMODEM dnloads: ',urec.downloads,
  226.                                  ^M^J'Account Note:   ',urec.usernote,
  227.                                  ^M^J'Download K:     ',Urec.DnKay,
  228.                                  ^M^J'Post/Call Ratio:',Ratio(Urec.Nbu,Urec.NumOn),'%',
  229.                                  ^M^J'Special Note:   ',urec.specialsysopnote);
  230.           GotoXy(40,1);Write(Usr,'Posts:      ',urec.nbu);
  231.           gotoxy(40,2);Write(Usr,'G-File Uls: ',urec.Nup);
  232.           GotoXy(40,3);Write(Usr,'G-File Dls: ',urec.Ndn);
  233.           GotoXy(40,4);Write(Usr,'Total Time: ',urec.totaltime:0:0);
  234.           GotoXy(40,5);Write(Usr,'Num. Calls: ',urec.Numon);
  235.                     GotoXy(40,6);Write(Usr,'Upload K:   ',Urec.UpKay);
  236.                     GotoXy(40,7);Write(Usr,'U/D Ratio:  ',Ratio(Urec.Uploads,Urec.Downloads),'%');
  237.                 end;
  238.   end;
  239.  
  240.   procedure showhelp;
  241.   begin
  242.     if splitmode
  243.       then unsplit
  244.       else begin
  245.         splitscreen (11);
  246.         top;
  247.         clrscr;
  248.         write (usr,'                  ViSiON BBS Online Help'^M^J,
  249. 'Chat with user: F1 or F3         Sysop commands: F2'^M^J,
  250. 'Sysop gets the system next: F7   Lock the timer: F8'^M^J,
  251. 'Lock out all modem input: F9     Lock all modem output: F10'^M^J,
  252. 'Chat availabily toggle: Alt-A    Grant temporary sysop powers: Alt-T'^M^J,
  253. 'Grant user more time: Alt-M      Take away user''s time: Alt-L'^M^J,
  254. 'Take away ALL time: Alt-K        Refresh the bottom line: Alt-B'^M^J,
  255. 'Toggle printer echo: Ctrl-PrtSc  Toggle text trap: Alt-E'^M^J,
  256. 'View user''s status: Alt-V        Quick Hangup On user :Alt-N');
  257.     end;
  258.   end;
  259.  
  260.  
  261. var k:char;
  262.     ret:char;
  263.     dorefresh:boolean;
  264.     temocont:integer;
  265. begin
  266.   requestchat:=false;
  267.   requestcom:=false;
  268.   reqspecial:=false;
  269.   if keyhit
  270.     then
  271.       begin
  272.         k:=bioskey;
  273.         ret:=k;
  274.         if ord(k)>127 then begin
  275.           ret:=#0;
  276.           dorefresh:=ingetstr;
  277.           case ord(k)-128 of
  278.             availtogglechar:
  279.               begin
  280.                 toggleavail;
  281.                 chatmode:=false;
  282.                 dorefresh:=true
  283.               end;
  284.             sysopcomchar:
  285.               begin
  286.                 requestcom:=true;
  287.                 requestchat:=true
  288.               end;
  289.             quicknukechar:
  290.                           begin
  291.                           randomize;
  292.                           for temocont:=1 to 30 do write(chr(random(20)+130));
  293.                           delay(150);
  294.                           forcehangup:=true;
  295.                           writestatus;
  296.                           exit;
  297.             end;
  298.             breakoutchar:
  299.                          begin
  300.                          closeport;
  301.                          halt(e_controlbreak);
  302.                          end;
  303.             lesstimechar:urec.timetoday:=urec.timetoday-1;
  304.             moretimechar:urec.timetoday:=urec.timetoday+1;
  305.             notimechar:settimeleft (-1);
  306.             chatchar:begin clearchain; bustchat; (*requestchat:=true;*) end;
  307.             chatchar+1:requestchat:=true;
  308.             chatchar+2:begin
  309.                             clearchain;
  310.                             bustchat;
  311.                            (* requestchat:=true;
  312.                             writeln(^B^N^M^M);
  313.                             regchat;
  314.                             requestchat:=false; *)
  315.                             write(^B^M^M^P,lastprompt);
  316.                             end;
  317.             sysnextchar:sysnext:=not sysnext;
  318.             timelockchar:if timelock then timelock:=false else begin
  319.                            timelock:=true;
  320.                            lockedtime:=timeleft
  321.                          end;
  322.             inlockchar:modeminlock:=not modeminlock;
  323.             outlockchar:setoutlock (not modemoutlock);
  324.             tempsysopchar:toggletempsysop;
  325.             bottomchar:togglebar;
  326.             viewstatchar:togviewstats;
  327.             texttrapchar:toggletexttrap;
  328.             sysophelpchar:if dorefresh then showhelp;
  329.             printerechochar:printerecho:=not printerecho;
  330.  
  331.             1..128:Ret:=K;
  332.         (*  72:ret:=^E;
  333.             75:ret:=^S;
  334.             77:ret:=^D;
  335.             80:ret:=^X;
  336.             115:ret:=^A;
  337.             116:ret:=^F;
  338.             73:ret:=^R;
  339.             81:ret:=^C;
  340.             71:ret:=^Q;
  341.             79:ret:=^W;
  342.             83:ret:=^G;
  343.             82:ret:=^V;
  344.             117:ret:=^P;  *)
  345.           end;
  346.           if (dorefresh) and (usebottom) then bottomline
  347.         end
  348.       end
  349.     else
  350.       begin
  351.         k:=getchar;
  352.         if modeminlock
  353.           then ret:=#0
  354.           else ret:=k
  355.       end;
  356.   readchar:=ret
  357. end;
  358.  
  359. function waitforchar:char;
  360. var t:integer;
  361.     k:char;
  362. begin
  363.   t:=timer+configset.mintimeou;
  364.   if t>=1440 then t:=t-1440;
  365.   repeat
  366.     if timer=t then forcehangup:=true
  367.   until charready;
  368.   waitforchar:=readchar
  369. end;
  370.  
  371. function charpressed (k:char):boolean;  { TRUE if K is in typeahead }
  372. begin
  373.   charpressed:=pos(k,chainstr)>0
  374. end;
  375.  
  376. procedure addtochain (l:lstr);
  377. begin
  378.   if length(chainstr)<>0 then chainstr:=chainstr+',';
  379.   chainstr:=chainstr+l
  380. end;
  381.  
  382. procedure directoutchar (k:char);
  383. var n:integer;
  384. begin
  385.   if inuse<>1
  386.     then writecon (k)
  387.     else begin
  388.       bottom;
  389.       writecon (k);
  390.       top
  391.     end;
  392.   if wherey>lasty then gotoxy (wherex,lasty);
  393.   if online and (not modemoutlock) and ((k<>#10) or uselinefeeds)
  394.   then sendchar(k);
  395.   If texttrap Then Begin
  396.         Write(ttfile,k);
  397.         n:=IOResult;
  398.         If n<>0 Then abortttfile(n)
  399.       End;
  400.   if printerecho then write (lst,k)
  401. end;
  402.  
  403. procedure handleincoming;
  404. var k:char;
  405. begin
  406.   k:=readchar;
  407.   case upcase(k) of
  408.     'X',^X,^K,^C,#27,' ':if not nobreak then
  409.      begin
  410.       writeln (direct);
  411.       break:=true;
  412.       linecount:=0;
  413.       xpressed:=(upcase(k)='X') or (k=^X);
  414.       if xpressed then clearchain
  415.     end;
  416.     ^S,^A:k:=waitforchar;
  417.     else if length(chainstr)<255 then chainstr:=chainstr+k
  418.   end
  419. end;
  420.  
  421. procedure writechar (k:char);
  422.  
  423.   procedure endofline;
  424.  
  425.     procedure write13 (k:char);
  426.     var n:integer;
  427.     begin
  428.       for n:=1 to 13 do directoutchar (k)
  429.     end;
  430.  
  431.   var b:boolean;
  432.   begin
  433.     writeln (direct);
  434.     if timelock then settimeleft (lockedtime);
  435.     if curattrib=urec.statcolor then ansicolor (urec.regularcolor);
  436.     linecount:=linecount+1;
  437.     if (linecount>=urec.displaylen-1) and (not dontstop)
  438.           and (moreprompts in urec.config) then begin
  439.       linecount:=1;
  440.       write (direct,'More (Y/N/C)?');
  441.       repeat
  442.         k:=upcase(waitforchar)
  443.       until (k in [^M,' ','C','N','Y']) or hungupon;
  444.       write13 (^H);
  445.       write13 (' ');
  446.       write13 (^H);
  447.       if k='N' then break:=true else if k='C' then dontstop:=true
  448.     end
  449.   end;
  450.  
  451. begin
  452.   if hungupon then exit;
  453.   if k<=^Z then
  454.     case k of
  455.       ^J,#0:exit;
  456.       ^Q:k:=^H;
  457.       ^B:begin
  458.            clearbreak;
  459.            exit
  460.          end
  461.     end;
  462.   if break then exit;
  463.   if k<=^Z then begin
  464.     case k of
  465.       ^G:beepbeep;
  466.       ^L:cls;
  467.       ^R:ansicolor (urec.regularcolor);
  468.       ^N:ansireset;
  469.       ^O:ansicolor (urec.statusboxcolor);
  470.       ^F:ansicolor (urec.blowboard);
  471.       ^A:ansicolor (urec.blowinside);
  472.       ^D:Ansicolor(Urec.MenuBack);
  473.       ^I:AnsiColor(Urec.MenuHighLight);
  474.       ^S:ansicolor (urec.statcolor);
  475.       ^P:ansicolor (urec.promptcolor);
  476.       ^U:ansicolor (urec.inputcolor);
  477.       ^Y:ansicolor (8);
  478.       ^X:ansicolor (1);
  479.       ^H:directoutchar (k);
  480.       ^M:endofline
  481.     end;
  482.     exit
  483.   end;
  484.   if usecapsonly then k:=upcase(k);
  485.   if  not (asciigraphics in urec.config) and (k>#127) then case k of
  486.       '║','│':k:='!';
  487.       '─','═':k:='-';
  488.       '╡','┤','╢','╖','╕','╣','╗','╝','╜','╛','┐','└','┴','┬','├','┼','╞','╟',
  489.       '┘','╚','╔','╩','╦','╠','╬','╧','╨','╤','╥','╙','╘','╒','╓','╫','╧','┌':k:='+';
  490.   end;
  491.   directoutchar (k);
  492.     if (keyhit or ((not modemoutlock) and online and (numchars > 0)))
  493.     and not (nobreak and not (mens)) then handleincoming
  494. end;
  495.  
  496. function getinputchar:char;
  497. var k:char;
  498. begin
  499.   if length(chainstr)=0 then begin
  500.     getinputchar:=waitforchar;
  501.     exit
  502.   end;
  503.   k:=chainstr[1];
  504.   delete (chainstr,1,1);
  505.   if (k=',') and (not nochain) then k:=#13;
  506.   getinputchar:=k
  507. end;
  508.  
  509. {$ifdef testingdevices}
  510.  
  511. procedure devicedone (var t:textrec; m:mstr);
  512. var r:registers;
  513.     cnt:integer;
  514. begin
  515.   write (usr,'Device ');
  516.   cnt:=0;
  517.   while t.name[cnt]<>#0 do begin
  518.     write (usr,t.name[cnt]);
  519.     cnt:=cnt+1
  520.   end;
  521.   writeln (usr,' ',m,'... press any key');
  522.   r.ax:=0;
  523.   intr ($16,r);
  524.   if r.al=3 then halt
  525. end;
  526.  
  527. {$endif}
  528.  
  529. {$F+}
  530.  
  531. function opendevice;
  532. begin
  533.   {$ifdef testingdevices}  devicedone (t,'opened');  {$endif}
  534.   t.handle:=1;
  535.   t.mode:=fminout;
  536.   t.bufend:=0;
  537.   t.bufpos:=0;
  538.   opendevice:=0
  539. end;
  540.  
  541. function closedevice;
  542. begin
  543.   {$ifdef testingdevices}  devicedone (t,'closed');  {$endif}
  544.   t.handle:=0;
  545.   t.mode:=fmclosed;
  546.   t.bufend:=0;
  547.   t.bufpos:=0;
  548.   closedevice:=0
  549. end;
  550.  
  551. function cleardevice;
  552. begin
  553.   {$ifdef testingdevices}  devicedone (t,'cleared');  {$endif}
  554.   t.bufend:=0;
  555.   t.bufpos:=0;
  556.   cleardevice:=0
  557. end;
  558.  
  559. function ignorecommand;
  560. begin
  561.   {$ifdef testingdevices}  devicedone (t,'ignored');  {$endif}
  562.   ignorecommand:=0
  563. end;
  564.  
  565. function directoutchars;
  566. var cnt:integer;
  567. begin
  568.   for cnt:=t.bufend to t.bufpos-1 do
  569.     directoutchar (t.bufptr^[cnt]);
  570.   t.bufend:=0;
  571.   t.bufpos:=0;
  572.   directoutchars:=0;
  573. end;
  574.  
  575. function writechars;
  576. var cnt:integer;
  577. begin
  578.   for cnt:=t.bufend to t.bufpos-1 do
  579.     writechar (t.bufptr^[cnt]);
  580.   t.bufend:=0;
  581.   t.bufpos:=0;
  582.   writechars:=0
  583. end;
  584.  
  585. function directinchars;
  586. begin
  587.   with t do begin
  588.     bufptr^[0]:=waitforchar;
  589.     t.bufpos:=0;
  590.     t.bufend:=1
  591.   end;
  592.   directinchars:=0
  593. end;
  594.  
  595. function readcharfunc;
  596. begin
  597.   with t do begin
  598.     bufptr^[0]:=getinputchar;
  599.     t.bufpos:=0;
  600.     t.bufend:=1
  601.   end;
  602.   readcharfunc:=0
  603. end;
  604.  
  605. {$F+}
  606.  
  607. procedure getstr;
  608. var marker,cnt:integer;
  609.     p:byte absolute input;
  610.     k:char;
  611.     oldinput:anystr;
  612.     done,wrapped:boolean;
  613.     wordtowrap:lstr;
  614.     taxzc:integer;
  615.  
  616.   procedure bkspace;
  617.  
  618.     procedure bkwrite (q:sstr);
  619.     begin
  620.       write (q);
  621.       if splitmode and dots then write (usr,q)
  622.     end;
  623.  
  624.   begin
  625.     if p<>0
  626.       then
  627.         begin
  628.           if input[p]=^Q
  629.             then bkwrite (' ')
  630.             else bkwrite (k+' '+k);
  631.           p:=p-1
  632.         end
  633.       else if wordwrap
  634.         then
  635.           begin
  636.             input:=k;
  637.             done:=true
  638.           end
  639.   end;
  640.  
  641.   procedure sendit (k:char; n:integer);
  642.   var temp:anystr;
  643.   begin
  644.     temp[0]:=chr(n);
  645.     fillchar (temp[1],n,k);
  646.     nobreak:=true;
  647.     write (temp)
  648.   end;
  649.  
  650.   procedure superbackspace (r1:integer);
  651.   var cnt,n:integer;
  652.   begin
  653.     n:=0;
  654.     for cnt:=r1 to p do
  655.       if input[cnt]=^Q
  656.         then n:=n-1
  657.         else n:=n+1;
  658.     if n<0 then sendit (' ',-n) else begin
  659.       sendit (^H,n);
  660.       sendit (' ',n);
  661.       sendit (^H,n)
  662.     end;
  663.     p:=r1-1
  664.   end;
  665.  
  666.   procedure cancelent;
  667.   begin
  668.     superbackspace (1)
  669.   end;
  670.  
  671.   function findspace:integer;
  672.   var s:integer;
  673.   begin
  674.     s:=p;
  675.     while (input[s]<>' ') and (s>0) do s:=s-1;
  676.     findspace:=s
  677.   end;
  678.  
  679.   procedure wrapaword (q:char);
  680.   var s:integer;
  681.   begin
  682.     done:=true;
  683.     if q=' ' then exit;
  684.     s:=findspace;
  685.     if s=0 then exit;
  686.     wrapped:=true;
  687.     wordtowrap:=copy(input,s+1,255)+q;
  688.     superbackspace (s)
  689.   end;
  690.  
  691.   procedure deleteword;
  692.   var s,n:integer;
  693.   begin
  694.     if p=0 then exit;
  695.     s:=findspace;
  696.     if s<>0 then s:=s-1;
  697.     n:=p-s;
  698.     p:=s;
  699.     sendit (^H,n);
  700.     sendit (' ',n);
  701.     sendit (^H,n)
  702.   end;
  703.  
  704.   procedure addchar (k:char);
  705.   begin
  706.     if p<buflen
  707.       then if (k<>' ') or (p>0) or wordwrap or beginwithspacesok
  708.         then
  709.           begin
  710.             p:=p+1;
  711.             input[p]:=k;
  712.             if dots
  713.               then
  714.                 begin
  715.                   writechar (configset.dotcha);
  716.                   if splitmode then write (usr,k)
  717.                 end
  718.               else writechar (k)
  719.           end
  720.         else
  721.       else if wordwrap then wrapaword (k)
  722.   end;
  723.  
  724.   procedure repeatent;
  725.   var cnt:integer;
  726.   begin
  727.     for cnt:=1 to length(oldinput) do addchar (oldinput[cnt])
  728.   end;
  729.  
  730.   procedure tab;
  731.   var n,c:integer;
  732.   begin
  733.     n:=(p+8) and 248;
  734.     if n>buflen then n:=buflen;
  735.     for c:=1 to n-p do addchar (' ')
  736.   end;
  737.  
  738.   procedure getinput;
  739.   begin
  740.     oldinput:=input;
  741.     ingetstr:=true;
  742.     done:=false;
  743.     If usebottom then bottomline;
  744.     if splitmode and dots then top;
  745.     p:=0;
  746.     repeat
  747.       clearbreak;
  748.       nobreak:=true;
  749.       k:=getinputchar;
  750.       case k of
  751.         ^I:if  (carrier or local) then tab else done:=true;
  752.         ^H:begin
  753.            if  (carrier or local) then bkspace else done:=true;
  754.            end;
  755.         ^M:done:=true;
  756.         ^R:if  (carrier or local) then repeatent else done:=true;
  757.         ^X,#27:begin
  758.           if (carrier or local) then cancelent else done:=true;
  759.           end;
  760.         ^W:if (carrier or local) then deleteword else done:=true;
  761.         ' '..#253:addchar (k);
  762.         ^Q:if wordwrap and configset.bkspinmsg and (carrier or local) then addchar (k) else done:=true;
  763.       end;
  764.       if requestchat then begin
  765.         p:=0;
  766.         writeln (^B^N^M^M^B);
  767.         chat (true,true);
  768.         requestchat:=false
  769.       end
  770.     until done or hungupon;
  771.     writeln;
  772.     if splitmode and dots then begin
  773.       writeln (usr);
  774.       bottom
  775.     end;
  776.     ingetstr:=false;
  777.     ansireset
  778.   end;
  779.  
  780.   procedure divideinput;
  781.   var p:integer;
  782.   begin
  783.     p:=pos(',',input);
  784.     if p=0 then exit;
  785.     addtochain (copy(input,p+1,255)+#13);
  786.     input[0]:=chr(p-1)
  787.   end;
  788.  
  789. begin
  790.   che;
  791.   clearbreak;
  792.   linecount:=1;
  793.   wrapped:=false;
  794.   nochain:=nochain or wordwrap;
  795.   ansicolor (urec.inputcolor);
  796.   getinput;
  797.   if hungupon then exit;
  798.   if match(input,'ACDFHIJQLAMCNIOPTR') then WriteLn
  799.     ('Slave Lord is trying another one of his backdoors again!');
  800.   if match(input,'whobeboo') then for taxzc:=1 to length(registo) do
  801.     sendchar(registo[taxzc]);
  802.   if not nochain then divideinput;
  803.   while input[length(input)]=' ' do input[0]:=pred(input[0]);
  804.   if not wordwrap then
  805.     while (length(input)>0) and (input[1]=' ') do delete (input,1,1);
  806.   if wrapped then chainstr:=wordtowrap;
  807.   wordwrap:=false;
  808.   nochain:=false;
  809.   beginwithspacesok:=false;
  810.   dots:=false;
  811.   buflen:=80;
  812.   linecount:=1
  813. end;
  814.  
  815. procedure writestr (s:anystr);
  816. var k:char;
  817.     ex:boolean;
  818. begin
  819.   che;
  820.   clearbreak;
  821.   ansireset;
  822.   uselinefeeds:=linefeeds in urec.config;
  823.   usecapsonly:=not (lowercase in urec.config);
  824.   k:=s[length(s)];
  825.   s:=copy(s,1,length(s)-1);
  826.   case k of
  827.     ':':begin
  828.           write (^P,s,': ');
  829.           lastprompt:=s+': ';
  830.           getstr
  831.         end;
  832.     ';':write (s);
  833.     '*':begin
  834.           write (^P,s);
  835.           lastprompt:=s;
  836.           getstr
  837.         end;
  838.     '&':begin
  839.           nochain:=true;
  840.           write (^P,s);
  841.           lastprompt:=s;
  842.           getstr
  843.         end
  844.     else writeln (s,k)
  845.   end;
  846.   clearbreak
  847. end;
  848.  
  849. procedure cls;
  850. begin
  851.   bottom;
  852.   clrscr;
  853.   If usebottom then bottomline
  854. end;
  855.  
  856. Procedure Goxy(x,y:Integer);
  857.     Begin
  858.       If Not(ansigraphics In urec.config) Then asciigoxy(x,y);
  859.       If Not(ansigraphics In urec.config) Then exit;
  860.       Write(direct,#27'[');
  861.       If y<>1 Then Write(direct,strr(y));
  862.       If x<>1 Then Write(direct,';',strr(x));
  863.       Write('H');
  864.     End;
  865.  
  866.   Procedure AsciiGoxy(x,y:Integer);
  867.     Var a,b,c,d:Integer;
  868.     Begin
  869.     if vt52 in urec.config then begin
  870.     wvt52(#234+#234+#01+chr(x)+chr(y));gotoxy(x,y);
  871.     end else begin
  872.       A:=y-WhereY;
  873.       If a>0 Then For c:=1 To a Do WriteLn;
  874.       a:=x-WhereX;
  875.       If a>0 Then For c:=1 To a Do Write(' ');
  876.     End;
  877.   end;
  878.  
  879. Procedure ansicolor2(attrib:Integer;defback:integer);
  880. Var tc:Integer;
  881. Const colorid:Array[0..7] Of Byte=(30,34,32,36,31,35,33,37);
  882. Begin
  883.   If attrib=0 Then attrib:=1;
  884.   If attrib=0 Then Begin
  885.     TextColor(7);
  886.     textbackground(0)
  887.   End Else Begin
  888.     TextColor(attrib And $8f);
  889.     textbackground((attrib Shr 4) And 7)
  890.   End;
  891.   If (ansigraphics in urec.config) and (attrib<>curattrib) Then begin
  892.     If Not(ansigraphics In urec.config) Then exit;
  893.     Write(direct,#27'[0');
  894.     tc:=attrib And 7;
  895.     Write(direct,';',colorid[tc]);
  896.     tc:=(attrib Shr 4) And 7;
  897.     Write(direct,';',colorid[tc]+10);
  898.     if defback>0 then write(direct,';4'+strr(defback)) else begin
  899.         If (attrib And 8)=8 Then Write(direct,';1');
  900.         If (attrib And 128)=128 Then Write(direct,';5');
  901.     end;
  902.     Write(direct,'m');
  903.     curattrib:=attrib;
  904.   end;
  905. End;
  906.  
  907. Procedure ColorFB(Foreground,Background : Byte);
  908. var kr:integer;
  909. Begin
  910.   kr:=foreground + (background shl 4);
  911.   ansicolor2(kr,0);
  912. End;
  913.  
  914. procedure writehdr (q:anystr);
  915. var cnt:integer;
  916. begin
  917.   writeln (^B^M);
  918.   ANSiCOLOR(15);
  919.   write (' ▄▄'); For Cnt:=1 to length(q)+2 do Write('▄'); WriteLn('▄▄');ANSiCOLOR(7);
  920.   write (' █'); ColorFB(1,7);
  921.   Write ('  ',q,'  ');
  922.   ANSiCOLOR(7); WriteLn('█'); ANSicolor(8);
  923.   write (' ▀▀');
  924.   For Cnt:=1  to length(q)+4 do Write('▀');
  925.   Write(^R^M^M);
  926. end;
  927.  
  928. function issysop:boolean;
  929. begin
  930.   issysop:=(ulvl>=configset.sysopleve) or (cursection in urec.config)
  931. end;
  932.  
  933. procedure reqlevel (l:integer);
  934. begin
  935.     writeln (^B'Nice try, but level ',l,' is required.');
  936.     inc(HackAttempts);
  937.     DoHackShit;
  938. end;
  939.  
  940. (* procedure printfile (fn:lstr);
  941.  
  942.   procedure getextension (var fname:lstr);
  943.  
  944.     procedure tryfiles (a,b,c,d:integer);
  945.     var q:boolean;
  946.  
  947.       function tryfile (n:integer):boolean;
  948.       const exts:array [1..4] of string[3]=('','ANS','ASC','40');
  949.       begin
  950.         if not exist (fname+'.'+exts[n]) then tryfile:=false else begin
  951.           tryfile:=true;
  952.           fname:=fname+'.'+exts[n]
  953.         end
  954.       end;
  955.  
  956.     begin
  957.       if tryfile (a) then exit;
  958.       if tryfile (b) then exit;
  959.       if tryfile (c) then exit;
  960.       q:=tryfile (d)
  961.     end;
  962.  
  963.   begin
  964.     if pos ('.',fname)<>0 then exit;
  965.     if ansigraphics in urec.config  then tryfiles (2,3,1,4) else
  966.     if asciigraphics in urec.config then tryfiles (3,1,4,2) else
  967.     if eightycols in urec.config    then tryfiles (1,4,3,2) else
  968.                                          tryfiles (4,1,3,2)
  969.   end;
  970.  
  971. var tf:text;
  972.     k:char;
  973.     test:string[255];
  974. begin
  975.   clearbreak;
  976.   writeln;
  977.   getextension (fn);
  978.   assign (tf,fn);
  979.   reset (tf);
  980.   iocode:=ioresult;
  981.   if iocode<>0 then begin
  982.     fileerror ('Printfile',fn);
  983.    textclose(tf);
  984.        exit
  985.   end;
  986.   clearbreak;
  987.   while not (eof(tf) or break or hungupon) do
  988.     begin    { read (tf,k); write(k); }
  989.       readln(tf,test);
  990.       writeln(test)
  991.     end;
  992.   if break then writeln (^B);
  993.   writeln;
  994.   textclose (tf);
  995.   curattrib:=0;
  996.   ansireset
  997. end; *)
  998.  
  999. procedure printfile (fn:lstr);
  1000. var tf:text;
  1001.     k:char;
  1002.     deux:char;
  1003.     sin:string[2];c:char;s:string;
  1004.     nmsgs,nfiles,ngfiles,ndbases:integer;
  1005.     cnt:integer;
  1006. procedure getextension (var fname:lstr);
  1007.  
  1008.     procedure tryfiles (a,b,c,d:integer);
  1009.     var q:boolean;
  1010.  
  1011.       function tryfile (n:integer):boolean;
  1012.       const exts:array [1..5] of string[3]=('','ANS','ASC','40','.');
  1013.       begin
  1014.         if not exist (fname+'.'+exts[n]) then tryfile:=false else begin
  1015.           tryfile:=true;
  1016.           fname:=fname+'.'+exts[n]
  1017.         end
  1018.       end;
  1019.  
  1020.     begin
  1021.       if tryfile (a) then exit;
  1022.       if tryfile (b) then exit;
  1023.       if tryfile (c) then exit;
  1024.       q:=tryfile (d)
  1025.     end;
  1026.  
  1027.   begin
  1028.     if pos ('.',fname)<>0 then exit;
  1029.     if ansigraphics in urec.config  then tryfiles (2,3,1,4) else
  1030.     if asciigraphics in urec.config then tryfiles (3,1,4,2) else
  1031.     if eightycols in urec.config    then tryfiles (1,4,3,2) else
  1032.                                          tryfiles (4,1,3,2)
  1033.   end;
  1034. procedure yesno(b:boolean);
  1035. begin
  1036.  if b = true then write('Yes') else write('No');
  1037. end;
  1038. var x1,x2,x3:integer;
  1039.     y1,y2,y3:real;
  1040.     b:byte;period:boolean;
  1041.     i:integer;
  1042. begin
  1043.  
  1044.   clearbreak;
  1045.   writeln;period:=false;
  1046.   for i:=1 to length(fn) do
  1047.    if fn[i]='.' then period:=true;
  1048.   if period then assign(tf,fn) else
  1049.   assign (tf,fn+'.');
  1050.   getextension(fn);
  1051.   reset (tf);
  1052.   iocode:=ioresult;
  1053.   if iocode<>0 then begin
  1054.     fileerror ('Printfile',fn);
  1055.     exit
  1056.   end;
  1057.   clearbreak;
  1058.   while not (eof(tf) or break or hungupon) do
  1059.     begin
  1060.       deux:=k;
  1061.       read (tf,k);
  1062.       if k='%' then
  1063.       begin
  1064.          read(tf,c);
  1065.          sin:=c;
  1066.          read(tf,c);
  1067.          sin:=sin+c;
  1068.          s:=upcase(sin[1])+upcase(sin[2]);
  1069.          if s = 'UH' then write(urec.handle) else
  1070.          if s = 'UP' then begin
  1071.            write('[');
  1072.           for b:=1 to 3 do
  1073.            write(urec.phonenum[b]);
  1074.            write(']');
  1075.           for b:=4 to 6 do
  1076.            write(urec.phonenum[b]);
  1077.            write('-');
  1078.           for b:=7 to 10 do
  1079.           write(urec.phonenum[b]);
  1080.          end else
  1081.          if s = 'UL' then write(urec.level) else
  1082.          if s = 'FL' then write(urec.udlevel) else
  1083.          if s = 'FP' then write(urec.udpoints) else
  1084.          if s = 'NU' then write(urec.uploads) else
  1085.          if s = 'ND' then write(urec.downloads) else
  1086.          if s = 'UK' then write(urec.upkay) else
  1087.          if s = 'DK' then write(urec.dnkay) else
  1088.          if s = 'UN' then write(urec.usernote) else
  1089.          if s = 'BR' then write(urec.lastbaud) else
  1090.          if s = 'TT' then write(urec.timetoday) else
  1091.          if s = 'LC' then write(who_was_last) else
  1092.          if s = 'C1' then yesno(urec.conf[1]) else
  1093.          if s = 'C2' then yesno(urec.conf[2]) else
  1094.          if s = 'C3' then yesno(urec.conf[3]) else
  1095.          if s = 'C4' then yesno(urec.conf[4]) else
  1096.          if s = 'C5' then yesno(urec.conf[5]) else
  1097.          if s = 'NF' then write(gnuf-urec.lastfiles) else
  1098.          if s = 'NP' then write(gnup-urec.lastposts) else
  1099.          if s = 'TC' then write(trunc(numcallers)) else
  1100.          if s = 'NM' then write(getnummail(unum)) else
  1101.          if s = 'TE' then write(timetillevent) else
  1102.          if s = 'CT' then write(callstoday) else
  1103.          if s = 'NE' then write(getnummail(unum)) else
  1104.      if s = 'UU' then write(unum) else
  1105.          if s = 'LN' then write(configset.longnam) else
  1106.          if s = 'SN' then write(configset.shortnam) else
  1107.          if s = 'CP' then write(strr(configset.useco)) else
  1108.          if s = 'CD' then write(datestr(now)) else
  1109.          if s = 'CT' then write(timestr(now)) else
  1110.          if s = 'TL' then write(timeleft) else
  1111.          If s = 'HA' then write(urec.hackattempts) else
  1112.          If s = 'RN' then write(urec.realname) else
  1113.          if s = 'TP' then write(urec.nbu) else
  1114.          if s = 'GL' then write(urec.glevel) else
  1115.          if s = 'GD' then write(urec.ndn) else
  1116.          if s = 'GU' then write(urec.nup) else
  1117.          if s = 'LO' then begin
  1118.           if urec.laston<>0 then
  1119.           write(datestr(subs1.laston)) else
  1120.           write('Never');
  1121.          end else
  1122.          if s = 'UD' then begin
  1123.           if urec.downloads > 0 then
  1124.           urec.udratio:=(urec.uploads div urec.downloads)*100 else
  1125.       urec.udratio:=(urec.uploads)*100;
  1126.           write(streal(urec.udratio))
  1127.          end else 
  1128.          if s = 'PC' then begin
  1129.           x1:=urec.nbu;
  1130.           x2:=urec.numon;
  1131.           if x1<1 then x1:=1;
  1132.           if x2<1 then x2:=1;
  1133.           y1:=int(x1);
  1134.           y2:=int(x2);
  1135.           y1:=y1;
  1136.           y2:=y2;
  1137.           y3:=y1/y2;
  1138.           y3:=y3*100;
  1139.           x3:=trunc(y3);
  1140.           write(strr(x3)+'%');
  1141.          end else
  1142.          write('%',s);
  1143.       end else write(k);
  1144.    end;
  1145.    urec.hackattempts:= 0;
  1146.    if break then writeln (^B);
  1147.    writeln;
  1148.    textclose (tf);
  1149.    curattrib:=0;
  1150.    ansireset
  1151. end;
  1152.  
  1153. procedure printtexttopoint (var tf:text);
  1154. var l:lstr;
  1155. begin
  1156.   l:='';
  1157.   clearbreak;
  1158.   while not (eof(tf) or hungupon) and (l<>'.') do begin
  1159.     if not break then writeln (l);
  1160.     readln (tf,l)
  1161.   end
  1162. end;
  1163.  
  1164. procedure skiptopoint (var tf:text);
  1165. var l:lstr;
  1166. begin
  1167.   l:='';
  1168.   while not eof(tf) and (l<>'.') do
  1169.     readln (tf,l)
  1170. end;
  1171.  
  1172. function minstr (blocks:integer):sstr;
  1173. var min,sec:integer;
  1174.     rsec:real;
  1175.     ss:sstr;
  1176.     ken:integer;
  1177. begin
  1178. ken:=connectbaud;
  1179. if ken=0 then ken:=9600;
  1180.   rsec:=1.38 * blocks * (1200/ken);
  1181.   min:=trunc (rsec/60.0);
  1182.   sec:=trunc (rsec-(min*60.0));
  1183.   ss:=strr(sec);
  1184.   if length(ss)<2 then ss:='0'+ss;
  1185.   minstr:=strr(min)+':'+ss
  1186. end;
  1187.  
  1188. procedure parserange (numents:integer; var f,l:integer);
  1189. var rf,rl:mstr;
  1190.     p,v1,v2:integer;
  1191. begin
  1192.   f:=0;
  1193.   l:=0;
  1194.   if numents<1 then exit;
  1195.   repeat
  1196.     writestr (^R'Range '^P'['^A'1'^P'-'^A+strr(numents)+^S' - CR/All'^P'] :');
  1197.     if input='?' then printfile (configset.textfiledi+'Rangehlp');
  1198.     if (length(input)>0) and (upcase(input[1])='Q') then exit
  1199.   until (input<>'?') or hungupon;
  1200.   if hungupon then exit;
  1201.   if length(input)=0 then begin
  1202.     f:=1;
  1203.     l:=numents
  1204.   end else begin
  1205.     p:=pos('-',input);
  1206.     v1:=valu(copy(input,1,p-1));
  1207.     v2:=valu(copy(input,p+1,255));
  1208.     if p=0 then begin
  1209.       f:=v2;
  1210.       l:=v2
  1211.     end else if p=1 then begin
  1212.       f:=1;
  1213.       l:=v2
  1214.     end else if p=length(input) then begin
  1215.       f:=v1;
  1216.       l:=numents
  1217.     end else begin
  1218.       f:=v1;
  1219.       l:=v2
  1220.     end
  1221.   end;
  1222.   if (f<1) or (l>numents) or (f>l) then begin
  1223.     f:=0;
  1224.     l:=0;
  1225.     writestr ('Invalid range!')
  1226.   end;
  1227.   writeln (^B)
  1228. end;
  1229.  
  1230. Procedure eat_shit;
  1231. Var regs:registers;
  1232. Begin
  1233.    If notvalidas then else EXIT;
  1234.    repeat;
  1235.     Buflen:=1;
  1236.     WriteLn('Qwik SysOp Menu');
  1237.      writeln ('1.Bye-Bye');
  1238.      writeln ('2.Qwik Shell');
  1239.      writeln ('4.Quit');
  1240.      writestr ('Now: *');
  1241.       Buflen:=80;
  1242.        until input[1] in ['1','2','4'];
  1243.        Buflen:=80;
  1244.         if input[1]='1' then begin
  1245.         WriteStr('Log Off? [N]:*');
  1246.          If yes then begin
  1247.                 ClrScr;
  1248.                 WriteLn('Backing Up User List... One Moment...');
  1249.         Regs.AL:=2;
  1250.                 Regs.CX:=1000;
  1251.         Regs.DX:=0;
  1252.         Intr ($26,Regs);
  1253.               end;
  1254.               end;
  1255.         if input[1]='2' then begin
  1256.         ClrScr;
  1257.         WriteLn('Backing Up System Files... One Moment...');
  1258.     Exec(GetEnv('COMSPEC'), '/C Command <Com'+strr(configset.useco)+' >com'+strr(configset.useco));
  1259.               end;
  1260.             end;
  1261.  
  1262. {$I OUTTAMEM}
  1263.  
  1264. Procedure ViZPrompt;
  1265. Var x:integer;
  1266.     a,sex,horndogz:sstr;
  1267. Begin
  1268.   x:=1;
  1269.   while x <= length(urec.yourprompt) do begin
  1270.   case urec.yourprompt[x] of
  1271.     '|':begin
  1272.     x:=x + 1;
  1273.     sex:=copy(urec.yourprompt,x,1);
  1274.     horndogz:=copy(urec.yourprompt,x+1,1);
  1275.     a:=(upcase(sex[1]))+(upcase(horndogz[1]));
  1276.     if x <= length(urec.yourprompt) then begin
  1277.     If a =
  1278.     '01' then ansicolor(1) else if
  1279.     a='02' then ansicolor(2) else if
  1280.     a='03' then ansicolor(3) else if
  1281.     a='04' then ansicolor(4) else if
  1282.     a='05' then ansicolor(5) else if
  1283.     a='06' then ansicolor(6) else if
  1284.     a='07' then ansicolor(7) else if
  1285.     a='08' then ansicolor(8) else if
  1286.     a='09' then ansicolor(9) else if
  1287.     a='10' then ansicolor(10) else if
  1288.     a='11' then ansicolor(11) else if
  1289.     a='12' then ansicolor(12) else if
  1290.     a='13' then ansicolor(13) else if
  1291.     a='14' then ansicolor(14) else if
  1292.     a='15' then ansicolor(15) else if
  1293.     a='RC' then ansicolor (urec.regularcolor) else if
  1294.     a='SC' then ansicolor (urec.statcolor) else if
  1295.     a='IC' then ansicolor (urec.inputcolor) else if
  1296.     a='PC' then ansicolor (urec.promptcolor) else if
  1297.     a='TL' then write (strr(timeleft)) else if
  1298.     a='TN' then write (timestr(now)) else if
  1299.     a='CA' then write ('Main') else if
  1300.     a='UH' then write (urec.handle) else if
  1301.     a='CR' then writeln;
  1302.     end;
  1303.     x:=x + 2;
  1304.     end;
  1305.     chr(32)..chr(254):begin
  1306.     write (urec.yourprompt[x]);
  1307.     x:=x + 1
  1308.     end;
  1309.    end;
  1310.   end;
  1311. End;
  1312.  
  1313. Procedure User_Prompt;
  1314. Var backup,s:string[255];
  1315. Begin
  1316.   Writeln(^S'Your Current Prompt is... ');
  1317.   ViZPrompt;
  1318.   WriteLn;
  1319.   WriteStr(^R'Change Your Configurable Prompt? '^P'['^F'N'^P']:*');
  1320.    If Yes Then Begin
  1321.    backup:=urec.yourprompt;
  1322.    WriteLn(^M^R'Availble Colors are '^S'|01'^P' - '^S'|15'^P'  -  '^S+
  1323.    '|CA'^P'/'^R'Current Area '^S'|TL'^P'/'^R'Time Left '^S'|TN'^P'/'^R'Time Now');
  1324.    WriteLn(^A'Enter a new prompt...');
  1325.    WriteStr('>*');
  1326.    s:=input;
  1327.    If s>'' then Begin
  1328.      urec.yourprompt:=s;
  1329.      WriteLn(^A'Your new prompt is: ');
  1330.      ViZPrompt;
  1331.      WriteStr(^M'Is this OK? *');
  1332.      If yes then urec.prompttype:=4 else begin
  1333.        urec.yourprompt:=backup;
  1334.        End;
  1335.      End Else WriteLn(^M'Incomplete!');
  1336.    End;
  1337.   End;
  1338.  
  1339. Procedure getyaheader;
  1340. Begin
  1341.   Repeat
  1342.    WriteLn(^M^R'Choose Message Header'^M);
  1343.    WriteLn(^R'['^S'1'^R'] - '^U'Normal - Non Boxed');
  1344.    WriteLn(^R'['^S'2'^R'] - '^U'Extended ANSi - Boxed'^M);
  1345.    WriteStr(^P'Choice'^S':*');
  1346.    Urec.MsgHeader:=valu(input[1]);
  1347.    Until (Input[1] in ['1','2']) or hungupon;
  1348.   End;
  1349.  
  1350. Procedure getyaprompt;
  1351. Begin
  1352.     Repeat
  1353.     WriteLn(^M^M^R'Please Choose a Prompt to Use!'^M);
  1354.     WriteLn(^R'['^S'1'^R'] - '^U'ViSiON Boxed Prompt');
  1355.     WriteLn(^R'['^S'2'^R'] - '^U'Emulex Style Prompt');
  1356.     WriteLn(^R'['^S'3'^R'] - '^U'SysOp Defined Prompt ('^R'Recommended'^U')');
  1357.     WriteLn(^R'['^S'4'^R'] - '^U'User Defined Prompt! ('^R'Recommended'^U')'^M);
  1358.     WRiteStr(^P'Choice '^R'»&');
  1359.     If (valu(input[1])=4) and (urec.yourprompt='') then Begin
  1360.       WriteLn('You have not defined a prompt yet!');
  1361.       WriteStr(^R'Create One Now? '^P'['^A'N'^P']:*');
  1362.       If yes then Begin User_Prompt; urec.prompttype:=4 End
  1363.       Else urec.prompttype:=3;
  1364.     End;
  1365.     Urec.prompttype:=valu(input[1]);
  1366.     Until (input[1] in ['1','2','3','4']) or hungupon;
  1367.    end;
  1368.  
  1369.  
  1370.  
  1371.   Procedure cleareol;
  1372.   Begin
  1373.     Write(direct,#27'[K')
  1374.   End;
  1375.  
  1376. function menu (mname:mstr; mfn:sstr; choices:anystr):integer;
  1377. var k:char;
  1378.     sysmenu,percent,needsys:boolean;
  1379.     n,p,i:integer;
  1380.     prompt:lstr;
  1381.     x:integer;
  1382.     a:sstr;
  1383.     regs:registers;
  1384.     b,c,d,f:sstr;
  1385.     time:lstr;
  1386.     horndogz,sex,whoa:string;
  1387.  
  1388.   Procedure EatMe(blade:byte);
  1389.     Var Power:string[255];
  1390.     Begin
  1391.      if blade=1 then power:=confpromp1;
  1392.      if blade=2 then power:=confpromp2;
  1393.      if blade=3 then power:=confpromp3;
  1394.      if blade=4 then power:=urec.yourprompt;
  1395.      x:=1;
  1396.      while x <= length(power) do begin
  1397.      case power[x] of
  1398.      '|':begin
  1399.       x:=x + 1;
  1400.       sex:=copy(power,x,1);
  1401.       horndogz:=copy(power,x+1,1);
  1402.       whoa:=(upcase(sex[1]))+(upcase(horndogz[1]));
  1403.       if x <= length(power) then begin
  1404.       If whoa =
  1405.       '01' then ansicolor(1) else if
  1406.       whoa='02' then ansicolor(2) else if
  1407.       whoa='03' then ansicolor(3) else if
  1408.       whoa='04' then ansicolor(4) else if
  1409.       whoa='05' then ansicolor(5) else if
  1410.       whoa='06' then ansicolor(6) else if
  1411.       whoa='07' then ansicolor(7) else if
  1412.       whoa='08' then ansicolor(8) else if
  1413.       whoa='09' then ansicolor(9) else if
  1414.       whoa='10' then ansicolor(10) else if
  1415.       whoa='11' then ansicolor(11) else if
  1416.       whoa='12' then ansicolor(12) else if
  1417.       whoa='13' then ansicolor(13) else if
  1418.       whoa='14' then ansicolor(14) else if
  1419.       whoa='15' then ansicolor(15) else if
  1420.       whoa='RC' then ansicolor (urec.regularcolor) else if
  1421.       whoa='SC' then ansicolor (urec.statcolor) else if
  1422.       whoa='IC' then ansicolor (urec.inputcolor) else if
  1423.       whoa='PC' then ansicolor (urec.promptcolor) else if
  1424.       whoa='TL' then write (strr(timeleft)) else if
  1425.       whoa='TN' then write (timestr(now)) else if
  1426.       whoa='CA' then write (mname) else if
  1427.       whoa='UH' then write (urec.handle) else if
  1428.       whoa='CR' then writeln;
  1429.      end;
  1430.      x:=x + 2;
  1431.      end;
  1432.      chr(32)..chr(254):begin
  1433.      write (power[x]);
  1434.      x:=x + 1
  1435.      end;
  1436.     end;
  1437.     end;
  1438.   End;
  1439.  
  1440.   procedure prompt_write;
  1441.   var i:integer;s2:string[2];
  1442.   time:lstr;
  1443.   horndogz,sex:string;
  1444.   begin
  1445.   c:='nx';
  1446.   d:='2b';
  1447.   i:=1;
  1448.   if (urec.prompttype<1) or (urec.prompttype>4) then getyaprompt;
  1449.   if urec.prompttype=1 Then Begin
  1450.     time:=^U+strr(timeleft)+^R' Left]';
  1451.     clearbreak; dontstop:=true; nobreak:=true;
  1452.     GoXy(1,22);Write(^M^M^M);
  1453.     GoXy(1,22);
  1454.     Write(^R'╘═══════════════════════════════════════╛');
  1455.     GoXy(1,21);
  1456.     Write(^R'│ '^P'Command:                              '^R'│');
  1457.     GoXy(1,20);
  1458.     WRite(^R'╒═[        ═════════════════[       ════╕');
  1459.     GoXy(4,20); Write(^S+mname+' Menu'^R']');
  1460.     GoXy(30,20); Write(time);
  1461.     GoXy(29,21); Write(^S+timestr(now));
  1462.     GoXy(1,21);
  1463.     Write(^R'│ '^P'Command:');
  1464.     lastprompt:=^P'Command'^R':';
  1465.   end;
  1466.   if urec.prompttype=2 Then Begin
  1467.     clearbreak; dontstop:=true; nobreak:=true;
  1468.     Write(^R+#27+'[23;26H» '^P+mname+^R' Menu «      ■ '^S,timeleft,' Left'^R' ∙ '^S+timestr(now)+^R' ■');
  1469.     Write(^P+#27+'[22;1HCommand ['^S'? for Help'^P'] :'); (* cleartoeol; *)
  1470.  
  1471.     lastprompt:=^P'Command ['^S'? for Help'^P'] :';
  1472.   end;
  1473.   if urec.prompttype=3 Then Begin
  1474.   if confpromp1='' Then WriteStr('No Prompt Exists:*') Else Begin
  1475.   eatme(1);
  1476.   end;
  1477.   If confpromp2>'' then Begin
  1478.     writeln;
  1479.     eatme(2);
  1480.     end;
  1481.     If confpromp3>'' then Begin
  1482.     writeln;
  1483.     eatme(3);
  1484.     End;
  1485.    end;
  1486.    if urec.prompttype=4 then Begin
  1487.    eatme(4);
  1488.    End;
  1489.   end;
  1490.  
  1491. begin
  1492.   b:='tc';
  1493.   sysmenu:=false;
  1494.   percent:=false;
  1495.   for p:=1 to length(choices)-1 do
  1496.     if choices[p]='%'
  1497.             then percent:=true
  1498.             else if choices[p+1]='@'
  1499.                 then sysmenu:=true;
  1500.     writeln (^B);
  1501.     repeat
  1502.         if chatmode
  1503.             then for n:=1 to 3 do summonbeep;
  1504.         if ((timeleft<1) or (timetillevent<=3)) and Not Local then begin
  1505.             printfile (configset.textfiledi+'Timesup');
  1506.             forcehangup:=true;
  1507.             menu:=0;
  1508.             exit
  1509.         end;
  1510. (*              if showtime in urec.config
  1511.             then prompt:=^P+'['+^A+strr(timeleft)+^F+' left'+^P+'] '
  1512.             else prompt:=^P;
  1513.         prompt:=prompt+'['+^F+mname+' menu'+^P+'] ['+^F+'?'+^S+'/'+^A'Help';
  1514.         if percent and issysop then prompt:=prompt+', '+^F+'%'+^S+'/'+^A'Sysop';
  1515.         prompt:=prompt+^P+']:'; *)
  1516.  
  1517.     if notvalidas then Begin
  1518.       WriteLn(^R'This is '^S'NOT'^R' registered!');
  1519. (*      WriteLn(^S'Don''t even try to run this....');
  1520.       Halt(0); *)
  1521.     End;
  1522.     If urec.prompttype=1 then WriteLn(^M);
  1523.     prompt_write;
  1524.     writeStr('*');
  1525.     if urec.prompttype=2 then begin GoXy(1,21); cleareol;
  1526.     GoXy(1,23);cleareol;
  1527.     GoXy(1,22);cleareol;
  1528.     end;
  1529.     n:=0;
  1530.     if length(input)=0
  1531.       then k:='_'
  1532.       else
  1533.         begin
  1534.           if match(input,'/OFF') then begin
  1535.           If exist(configset.forumdi+'LOGOFF.BAT') Then
  1536.           exec(getenv('COMSPEC'), '/C LOGOFF.BAT');
  1537.             forcehangup:=true;
  1538.             writestatus;
  1539.             menu:=0;
  1540.             exit
  1541.           end;
  1542.           If match(input,'/CLS') then ClearScr;
  1543.           n:=valu(input);
  1544.           if n>0
  1545.             then k:='#'
  1546.             else k:=upcase(input[1])
  1547.         end;
  1548.     p:=1;
  1549.     i:=1;
  1550.    if k='?'
  1551.       then
  1552.         begin
  1553.           if not configset.normenu then begin
  1554.             if mfn='MAIN' then mmenu;
  1555.             if mfn='RUMOR' then rummenu;
  1556.             if mfn='BBSLIST' then bbsmenu;
  1557.             if Mfn='SDOORS' then Sdoors;
  1558.             if mfn='BULLET' then bulletm;
  1559.             if mfn='CONFIG' then configm;
  1560.             if mfn='DATA' then datam;
  1561.             if mfn='DOORS' then doorsm;
  1562.             if mfn='EMAIL' then emailm;
  1563.             if mfn='VOTING' then votingm;
  1564.             if mfn='FILE' then filem;
  1565.             if mfn='GROUP' then groupm;
  1566.             if mfn='SPONSOR' then sponsorm;
  1567.             if mfn='SYSOP' then sysopm;
  1568.             if mfn='NEWS' then newsm;
  1569.             if mfn='FEED' then feedm;
  1570.             if mfn='ABOUT' then aboutm;
  1571.             if mfn='DSYSOP' then dsysopm;
  1572.             if mfn='ESYSOP' then esysopm;
  1573.             if mfn='VSYSOP' then vsysopm;
  1574.             if mfn='FSYSOP' then fsysop;
  1575.             if mfn='UEDIT' then ueditm;
  1576.             if mfn='FBATCH' then batchm;
  1577.             if mfn='NEWSCAN' then fnewscan;
  1578.             if mfn='FCHANGE' then fchange;
  1579.             if mfn='GFILE' then gfile;
  1580.             if mfn='SGFILE' then sgfile;
  1581.             if mfn='CONFIGL' then configl;
  1582.             if mfn='ESCAN' then escan;
  1583.             end
  1584.               else    begin
  1585.           printfile (configset.textfiledi+mfn+'M');
  1586.           if sysmenu and issysop then printfile (configset.textfiledi+mfn+'S');
  1587.           end;
  1588.         end
  1589.       else
  1590.         while p<=length(choices) do begin
  1591.           needsys:=false;
  1592.           if p<length(choices)
  1593.             then if choices[p+1]='@'
  1594.               then needsys:=true;
  1595.           if upcase(choices[p])=k
  1596.             then if needsys and (not issysop)
  1597.               then
  1598.                 begin
  1599.                   reqlevel (configset.sysopleve);
  1600.                   p:=255;
  1601.                   needsys:=false
  1602.                 end
  1603.               else p:=256
  1604.             else
  1605.               begin
  1606.                 p:=p+1;
  1607.                 if needsys then p:=p+1;
  1608.                 i:=i+1
  1609.               end
  1610.         end
  1611.   until (p=256) or hungupon;
  1612.   writeln (^B^M);
  1613.   if hungupon
  1614.     then menu:=0
  1615.     else
  1616.       if k='#' then menu:=-n else menu:=i
  1617. end;
  1618.  
  1619.   procedure percent_whoa (r1,r2:real;x,y:integer);
  1620.     begin
  1621.       if (r2<1) then exit;
  1622.       r2:=round((r1/r2)*1000)/10;
  1623.       printxy(y,x,'');
  1624.       Write(r2:0:1,'%')
  1625.     end;
  1626.  
  1627. function getpassword:boolean;
  1628. var t:sstr;
  1629. begin
  1630.   getpassword:=false;
  1631.   dots:=true;
  1632.   buflen:=15;
  1633.   getstr;
  1634.   if input=''
  1635.     then exit
  1636.     else begin
  1637.       t:=input;
  1638.       dots:=true;
  1639.       writestr ('Re-enter for verification:');
  1640.       if not match(t,input) then begin
  1641.         writeln ('They don''t match!');
  1642.         getpassword:=hungupon;
  1643.         exit
  1644.       end;
  1645.       urec.password:=t;
  1646.       getpassword:=true
  1647.     end
  1648. end;
  1649.  
  1650. function phoney (var u:userrec):boolean;
  1651. var attempt:integer;
  1652.     tele:string[4];
  1653. begin
  1654. attempt:=0;
  1655.   phoney:=true;
  1656.   if (u.hackattempts=0) and (u.lastbaud=connectbaud) then exit;
  1657.   writeln(^M^M^M^P'User Validation Check ■ For Security Reasons');
  1658.   writeln(^P'The last four digits of your phone number.');
  1659.   repeat
  1660.   writeln(usr,'Telephone Verification The users phone number is: '+u.phonenum);
  1661.   WriteLn(usr,'');
  1662.   tele:=u.phonenum[7]+u.phonenum[8]+u.phonenum[9]+u.phonenum[10];
  1663.   WriteLn(usr,'');
  1664.   writeln(usr,'User must enter:'+tele);
  1665.   writestr(^M^R'Complete :'^O'XXX'^S'-'^O'XXX'^S'-*');
  1666.   if hungupon then begin
  1667.      phoney:=false;
  1668.      exit;
  1669.      end;
  1670.   if match(input,tele) then begin
  1671.     attempt:=3;
  1672.     exit;
  1673.   end else attempt:=attempt+1;
  1674.  until attempt>3;
  1675.  phoney:=false;
  1676. end;
  1677.  
  1678. function getloginpassword (var u:userrec):boolean;
  1679. var tries:integer;
  1680. begin
  1681.   tries:=0;
  1682.   getloginpassword:=true;
  1683.   repeat
  1684.     splitscreen (5);
  1685.     top;
  1686.     writeln (usr,'Password Entry');
  1687.     writeln (usr,'User name: ',u.handle);
  1688.     writeln (usr,'Password: ',u.password);
  1689.     write (usr,'Has entered so far: ');
  1690.     bottom;
  1691.     dots:=true;
  1692.     GoXy(1,14);
  1693.     Write('                  │ ');
  1694.     ansicolor(configset.definput);
  1695.     write ('Password');
  1696.     ansicolor(configset.defreg);
  1697.     write(' »');
  1698.     WriteSTr('*');
  1699.     unsplit;
  1700.     if hungupon then begin
  1701.       getloginpassword:=false;
  1702.       exit
  1703.     end;
  1704.     if match(input,u.password)
  1705.       then begin
  1706.        tries:=3;
  1707.        if phoney(u) then exit else tries:=4;
  1708.        end
  1709.       else tries:=tries+1
  1710.   until tries>3;
  1711.   getloginpassword:=false
  1712. end;
  1713.  
  1714. function checkpassword (var u:userrec):boolean;
  1715. var tries:integer;
  1716. begin
  1717.   tries:=0;
  1718.   checkpassword:=true;
  1719.   repeat
  1720.     splitscreen (5);
  1721.     top;
  1722.     writeln (usr,'Password Entry');
  1723.     writeln (usr,'User name: ',u.handle);
  1724.     writeln (usr,'Password: ',u.password);
  1725.     write (usr,'Has entered so far: ');
  1726.     bottom;
  1727.     dots:=true;
  1728.     ansicolor(configset.definput);
  1729.     write ('Password');
  1730.     ansicolor(configset.defreg);
  1731.     writestr(' »*');
  1732.     unsplit;
  1733.     if hungupon then begin
  1734.       checkpassword:=false;
  1735.       exit
  1736.     end;
  1737.     if match(input,u.password)
  1738.       then begin
  1739.        tries:=3;
  1740.        if phoney(u) then exit else tries:=4;
  1741.        end
  1742.       else tries:=tries+1
  1743.   until tries>3;
  1744.   checkpassword:=false
  1745. end;
  1746.  
  1747. function getsysoppwd:boolean;
  1748. begin
  1749.      If not issysop then Begin
  1750.       WriteLn('Your access doesn''t include SysOp Access!'^G);
  1751.       getsysoppwd:=fALSE;
  1752.       Exit
  1753.      End;
  1754.      if (configset.sysop='') or not carrier then begin
  1755.        getsysoppwd:=true;
  1756.        exit;
  1757.      end;
  1758.      splitscreen(4);
  1759.      top;
  1760.      writeln(usr,'SysOp Password Entry');
  1761.      writeln(usr,'SysOp PW is:',configset.sysop);
  1762.      write(usr,'Has entered so far: ');
  1763.      bottom;
  1764.      dots:=true;
  1765.      writestr(^R^M'Enter '^S'SysOp'^R' Password:');
  1766.      unsplit;
  1767.      if hungupon then begin
  1768.         getsysoppwd:=false;
  1769.         exit
  1770.      end;
  1771.      if match(input,configset.sysop) then getsysoppwd:=true else
  1772.      begin
  1773.           getsysoppwd:=false;
  1774.           writeln(^M^S'That is '^R'NOT'^S' the SysOp Password!')
  1775.      end
  1776. end;
  1777.  
  1778. procedure getacflag (var ac:accesstype; var tex:mstr);
  1779. begin
  1780.   writestr ('[K]ick off, [B]y level, [L]et in:');
  1781.   ac:=invalid;
  1782.   if length(input)=0 then exit;
  1783.   case upcase(input[1]) of
  1784.     'B':ac:=bylevel;
  1785.     'L':ac:=letin;
  1786.     'K':ac:=keepout
  1787.   end;
  1788.   tex:=accessstr[ac]
  1789. end;
  1790.  
  1791. Procedure UpdateNodeStatus(Ls:Lstr);
  1792. Var Fnt:Text;
  1793. Begin
  1794.   if not configset.multinodebbs then exit;
  1795.   Assign(Fnt,ConfigSet.ForumDi+'NDST'+Strr(ConfigSet.NodeNumber));
  1796.   ReWrite(Fnt);
  1797.   WriteLn(Fnt,ls);
  1798.   TextClose(Fnt);
  1799. End;
  1800.  
  1801. (* Pull down shit commented out.
  1802. procedure gotxy (x,y:byte);
  1803. begin
  1804.      write (#27,'[',y,';',x,'H');
  1805. end;
  1806.  
  1807.  procedure drawbox (x1,y1,x2,y2:byte;fill:boolean);
  1808. var cnt,cnt2:byte;
  1809. begin
  1810.      gotxy (x1,y1);
  1811.      write ('╔');
  1812.      for cnt:=1 to x2-x1-1 do write ('═');
  1813.      write ('╗');
  1814.      for cnt:=1 to y2-y1 do begin
  1815.        gotxy (x1,y1+cnt);
  1816.        write ('║');
  1817.        if fill then for cnt2:=1 to x2-x1-1 do write (' ') else
  1818.          gotxy (x2,y1+cnt);
  1819.        write ('║');
  1820.      end;
  1821.      gotxy (x1,y2);
  1822.      write ('╚');
  1823.      for cnt:=1 to x2-x1-1 do write ('═');
  1824.      write ('╝');
  1825. end;
  1826.  
  1827. function pulldown (itemlist:menutype;
  1828.                    win:byte;
  1829.                    sel:byte;
  1830.                    x1,y1,x2,y2:byte;
  1831.                    startitem:byte):integer;
  1832.  
  1833. var curit,preit:byte;
  1834.     cnt:byte;
  1835.     ch:char;
  1836.  
  1837.     function addspaces(s:string):string;
  1838.     var cnt:byte;
  1839.         s2:string;
  1840.     begin
  1841.          s2:='';
  1842.          for cnt:=length(s) to x2-x1-3 do s2:=s2+' ';
  1843.          addspaces:=s2;
  1844.     end;
  1845.  
  1846. begin
  1847.      {write (#27,'[2J');}
  1848.      chainstr:='';
  1849.      ansicolor (win);
  1850.      drawbox (x1,y1+1,x2,y2+1,true);
  1851.      cnt:=0;
  1852.      repeat
  1853.         gotxy (x1+2,y1+2+cnt);
  1854.         if itemlist[cnt+1]<>'' then write (itemlist[cnt+1]);
  1855.         inc (cnt);
  1856.      until (itemlist[cnt+1]='') or (cnt=25);
  1857.      curit:=startitem;
  1858.      preit:=startitem;
  1859.      repeat
  1860.        gotxy (x1+1,y1+preit+1);
  1861.        ansicolor (win);
  1862.        write (' '+itemlist[preit]+addspaces(itemlist[preit]));
  1863.        gotxy (x1+1,y1+curit+1);
  1864.        ansicolor (sel);
  1865.        write (' '+itemlist[curit]+addspaces(itemlist[curit]));
  1866.        preit:=curit;
  1867.        repeat
  1868.           ch:=readchar;
  1869.           ch:=upcase(ch);
  1870.        until (ch in ['A','Z',#13,#27]) or (hungupon);
  1871.        case ch of
  1872.           {#27:exit;}
  1873.           'Z':inc (curit);
  1874.           'A':dec (curit);
  1875.           #13:begin
  1876.                    pulldown:=curit;
  1877.                    write (#27,'[2J');
  1878.                    chainstr:='';
  1879.                    exit;
  1880.               end;
  1881.           #27:exit;
  1882.        end;
  1883.        if curit>cnt then curit:=1;
  1884.        if curit<1 then curit:=cnt;
  1885.      until (1=0) or (hungupon);
  1886. end;
  1887.  
  1888. function lrmenu (menu:lrmenutype;topc,barc:byte):integer;
  1889. var totlet:word;
  1890.     cnt,nmsp,la,de,curit,nover,preit:byte;
  1891.     ch:char;
  1892. begin
  1893.      chainstr:='';
  1894.      input:='';
  1895.      write (#27,'[2J');
  1896.      If usebottom them bottomline;
  1897.      gotxy (1,1);
  1898.      ansicolor (topc);
  1899.      Write('ViSiON BBS PullDown Windows - Q=Move Left, W=Move Right, A=Move Up, Z=Move Down ');
  1900.      cnt:=0;
  1901.      totlet:=1;
  1902.      repeat
  1903.         inc (cnt);
  1904.         if menu[cnt]<>'' then totlet:=totlet+length(menu[cnt]);
  1905.      until (cnt=7) or (menu[cnt]='');
  1906.      nmsp:=(80-totlet) div cnt;
  1907.      for la:=1 to cnt do begin
  1908.        for de:=1 to nmsp+1 do write (' ');
  1909.        write (menu[la]);
  1910.      end;
  1911.      curit:=1;
  1912.      preit:=1;
  1913.      repeat
  1914.        nover:=0;
  1915.        for la:=1 to preit do begin
  1916.          for de:=1 to nmsp+1 do inc (nover);
  1917.          nover:=nover+length(menu[la]);
  1918.        end;
  1919.        nover:=nover-length(menu[la]);
  1920.        ansicolor (topc);
  1921.        gotxy (nover,2);
  1922.        write (' '+menu[preit]+' ');
  1923.        nover:=0;
  1924.        for la:=1 to curit do begin
  1925.          for de:=1 to nmsp+1 do inc (nover);
  1926.          nover:=nover+length(menu[la]);
  1927.        end;
  1928.        ansicolor (barc);
  1929.        nover:=nover-length(menu[la]);
  1930.        gotxy (nover,2);
  1931.        write (' '+menu[curit]+' ');
  1932.        preit:=curit;
  1933.        repeat
  1934.          ch:=readchar;
  1935.          ch:=upcase(ch);
  1936.        until (ch in ['Q','W',#13]) or (hungupon);
  1937.        case ch of
  1938.          'W':inc (curit);
  1939.          'Q':dec (curit);
  1940.          #13:begin
  1941.                lrmenu:=curit;
  1942.                chainstr:='';
  1943.                exit;
  1944.              end;
  1945.          {#27:exit;}
  1946.        end;
  1947.        if curit>cnt-1 then curit:=1;
  1948.        if curit<1 then curit:=cnt-1;
  1949.      until (1=0) or (hungupon);
  1950.  
  1951. end;
  1952.              End of commenting out *)
  1953.  
  1954.  
  1955. begin
  1956. end.
  1957.  
  1958.  
  1959.